﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<fmt:setBundle basename="/bundles/autobaseAdminBundle" />
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title><fmt:message key="admin.title.site" /></title>
        <link href="../layout/css/main.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="../layout/jsc/jquery.min.js"></script>
        <script type="text/javascript" src="../layout/jsc/jquery.global.js"></script>
        <script type="text/javascript" src="../layout/jsc/blockUI.js"></script>
        <script type="text/javascript" src="../layout/jsc/jquery.simplemodal.js"></script>
        
    </head>

    <body>

		<table id="conteiner">
            <tr>
                <td id="header">
                    <div id="admin_cabinet">
                    	<a href="/admin.do">
                    		<h2><fmt:message key="admin.header"></fmt:message> </h2>
                    	</a>
                    </div>
                </td>
            </tr>
            <tr>
				<td id="content_left">
            		<div class="list">
            			<ul>
            				<li>
            					<a href="/admin/orders.do"><fmt:message key="admin.orders" /></a>
            				</li>
            				<li>
            					<a href="/admin/drivers.do"><fmt:message key="admin.drivers" /></a>
            				</li>
            				<li>
            					<a href="/admin/logout.do" ><fmt:message key="admin.logout" /></a>
            				</li>
            			</ul>
            		</div>
	            </td>
                <td id="content_center">
                	<c:set var="message" value="${ sessionScope['adminMessage']}" scope="session"></c:set>
                    <c:if test="${ not empty message }">
                		
                		<script type="text/javascript">
                			showMessage('${message}');
                		</script>
                		<c:remove var="message" />
                		<!-- <div class="mess sucess">
	                    	 <c:out value="${ message}"></c:out>
	                    	 
	                    	 
	                    </div> -->
                	</c:if> 
                	<c:set var="error" value="${ sessionScope['adminError']}"></c:set>
                    <c:if test="${ not empty error }">
                    	<script type="text/javascript">
                			showMessage('${error}');
                		</script>
                		<c:remove var="error" />
                		<!--  <div class="mess error_m">
	                    	 <c:out value="${ error}"></c:out>
	                    	 
	                    </div>-->
                	</c:if> 
                	
                	<c:set var="page" value="${ requestScope['page'] }"> </c:set>
                	<c:choose>
	                	<c:when test="${page == 'order' }">
	                		<c:import url="/admin/orderList.jsp"></c:import>
	                	</c:when>
	                	<c:when test="${page == 'drivers' }">
	                		<c:import url="/admin/driverList.jsp"></c:import>
	                	</c:when>
	                	<c:otherwise>
                			<jsp:include page="/admin/adminPanel.jsp" />
                		</c:otherwise>
                	</c:choose>
                	
                </td>
            </tr>
            <tr>
            	<td></td>
            	<td></td>
                <jsp:include page="/footer.jsp" />
            </tr>

        </table>
    </body>
</html>